package serivce

import (
	"context"
	"petCombo-srv/dao"
	"petCombo-srv/internal/model"
	__ "petCombo-srv/proto"
	"strconv"
)

func (p *Pets) PetAdd(_ context.Context, in *__.PetAddRep) (*__.PetAddResp, error) {

	PetAddService := dao.NewPetListService()
	PetId := PetAddService.PetAdd(model.Pets{
		Name:                   in.Name,
		Gender:                 int(in.Gender),
		PetId:                  strconv.FormatInt(in.PetId, 10),
		SterilizationSituation: int(in.SterilizationSituation),
		VaccineSituation:       int(in.VaccineSituation),
		DewormingSituation:     int(in.DewormingSituation),
	})

	return &__.PetAddResp{
		PetId: int64(PetId),
	}, nil
}
